using UnityEditor.Animations;

namespace IQIGame.Onigao.GamePlay.Editors
{

    public static class AnimatorToolConstant
    {
        public readonly static GenAnimatorBase[] AniamtorGenerator = new GenAnimatorBase[]
        {
            null,
            new GenAnimatorLevelEntity(),
            new GenAnimatorLevelCharacter(),
            new GenAnimatorBattleCharacter(),
            new GenAnimatorBattleMonster(),
            new GenAnimatorLive2D(),
        };

        public const string State_Empty = "Empty";
        public const string State_IdleMoveTree = "StandMove";
        public const string State_Idle = "Idle";
        public const string State_LongIdle = "LongIdle";
        public const string State_Die = "Die";
        public const string State_Born = "Born";
        public const string State_NormalAttack = "Attack";
        public const string State_TurnLeft = "TurnLeft";
        public const string State_TurnRight = "TurnRight";


        public const string State_JumpStart = "Jump_Start";
        public const string State_JumpLoop = "Jump_Loop";
        public const string State_JumpEnd = "Jump_End";

        public const string Param_Reset = "Reset";
        public const string Param_Die = "Die";
        public const string Param_Speed = "Speed";
        public const string Param_JoyStickPower = "JoyStickPower";
        public const string Param_JumpEnd = "JumpEnd";
        public const string Param_Born = "Born";
        public const string Param_JumpStart = "JumpStart";
        public const string Param_Stand2Idle = "Stand2Idle";
        public const string Param_StartMove = "StartMove"; //trigger，和speed不重复，因为speed可能会缓动改变，speed大于0未必是处于移动状态


        public static AnimatorState GetStateByName(this AnimatorStateMachine stateMachine, string stateName)
        {
            foreach (ChildAnimatorState childState in stateMachine.states)
            {
                if (childState.state.name == stateName)
                {
                    return childState.state;
                }
            }
            return null; // Return null if no state with the given name is found
        }


    }

}
